<?php

use think\migration\Migrator;
use think\migration\db\Column;

class BasicDrain extends Migrator
{
    public function up()
    {
        $table = $this->table('basic_drain');
        $table
            ->addColumn('region_id', 'integer', ['limit' => 11, 'default' => '53', 'comment' => '区域ID'])
            ->addColumn('company_id', 'integer', ['limit' => 2, 'default' => '0', 'comment' => '公司ID'])
            ->addColumn('data_from_paikoubianhao', 'integer', ['limit' => 2, 'default' => '0', 'comment' => '工况数据中的排口编号'])
            ->addColumn('name', 'string', ['limit' => 50, 'default' => '', 'comment' => '排口名称'])
            ->addColumn('description', 'string', ['limit' => 200, 'comment'=>'排口简介'])
            ->addColumn('delete_time', 'integer', ['limit' => 11, 'default' => 0, 'comment'=>'软删除'])

            //注释
            ->setComment('基本信息 - 排口')

            //引擎
            ->setEngine('InnoDB')
            ->save();
    }

    public function down()
    {
        $this->table('basic_drain')->drop();
    }
}
